/***************************************************************************** 
* 
* File Name : main.c
* 
* Description: main 
* 
* Copyright (c) 2014 Winner Micro Electronic Design Co., Ltd. 
* All rights reserved. 
* 
* Author : dave
* 
* Date : 2014-6-14
*****************************************************************************/ 
#include "wm_include.h"
#include "cn_apsta.h"
#include "cn_tcpserver.h"
#include "cn_usart_x.h"
#include "fifo_process.h"
#include "cn_udp.h"
#include "cn_data_flash.h"
static char apsta_ssid[33];
static char apsta_pwd[65];
static char apsta_apssid[33];
static char apsta_appwd[65];
//static cn_uart_options_t  opt;
void UserMain(void)
{
	printf("\n wifi2usart,4 channel \n");
	printf("\n usart 1---> RX:PB07  TX:PB06 \n");
	printf("\n usart 2---> RX:PB03  TX:PB02 \n");
	printf("\n usart 3---> RX:PB01  TX:PB00 \n");	
	printf("\n usart 4---> RX:PB05  TX:PB04 \n");
	network_para_init();
	get_ap_wifi(apsta_apssid,apsta_appwd);
	get_sta_wifi(apsta_ssid,apsta_pwd);
	cn_apsta_create(apsta_ssid,apsta_pwd,apsta_apssid,apsta_appwd);
	// opt.baudrate = 115200;
	// opt.charlength = TLS_UART_CHSIZE_8BIT;
	// opt.flow_ctrl = TLS_UART_FLOW_CTRL_NONE;
	// opt.paritytype = TLS_UART_PMODE_DISABLED;
	// opt.stopbits = TLS_UART_ONE_STOPBITS;
	// set_all_usart_config(&opt);
//	cn_apsta_create("lrc","13510872134","wifi2usart","123456789");
//	cn_create_socket_server();
//	set_all_usart_config(115200,-1,-1);
    CreateWlanFifoTask();
    socket_udp_init();
#if DEMO_CONSOLE
	CreateDemoTask();
#endif
//�û��Լ���task
}

